package com.basic.java.spring5.service;

import com.basic.java.spring5.dao.UserDao;
import com.basic.java.spring5.dao.impl.UserDaoImpl;

/**
 * 类
 * 创建时间：2022/3/2 21:35
 *
 * @author gejin
 */
public class UserService {
    // 创建UserDao对象， 生成set 方法
    private UserDao userDao;

    public void setUserDao(UserDao userDao) {
        this.userDao = userDao;
    }

    public void add() {
        System.out.println("Service add ...");
        userDao.update();
        // 传统调用dao 层接口的方法
        UserDao dao = new UserDaoImpl();
        dao.update();
    }

}
